package com.bookstore.domain;

import java.sql.Date;
import java.util.LinkedHashSet;
import java.util.Set;

/**
* @ClassName: Trade
* @Description: TODO(订单域，每个订单有个商品)
* @author Administrator liy
* @date 2017年5月25日
*/
public class Trade {
	// trade 对象对应的id
	private Integer tradeId;
	private Date tradeTime;
	// 多个tradeitem 
	private Set<TradeItem> items = new LinkedHashSet<TradeItem>();
	//和 Trade 关联的 User 的 userId
	private Integer userId;
	
	public Trade() {
		super();
	}
	public Trade(Integer tradeId, Date tradeTime, Set<TradeItem> items, Integer userId) {
		super();
		this.tradeId = tradeId;
		this.tradeTime = tradeTime;
		this.items = items;
		this.userId = userId;
	}
	
	public Integer getTradeId() {
		return tradeId;
	}
	public void setTradeId(Integer tradeId) {
		this.tradeId = tradeId;
	}
	public Date getTradeTime() {
		return tradeTime;
	}
	public void setTradeTime(Date tradeTime) {
		this.tradeTime = tradeTime;
	}
	public Set<TradeItem> getItems() {
		return items;
	}
	public void setItems(Set<TradeItem> items) {
		this.items = items;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	@Override
	public String toString() {
		return "Trade [tradeId=" + tradeId + ", tradeTime=" + tradeTime + ", items=" + items + ", userId=" + userId
				+ "]";
	}

}
